comment
authorJoey Hess <joeyh@joeyh.name>
Tue, 13 Sep 2022 18:58:45 +0000 (14:58 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 13 Sep 2022 18:58:45 +0000 (14:58 -0400)
doc/forum/Ensure_all_versions_are_on_remotes/comment_2_ad5f1f0b98032361e64bb7275d23e97c._comment [new file with mode: 0644]

diff --git a/doc/forum/Ensure_all_versions_are_on_remotes/comment_2_ad5f1f0b98032361e64bb7275d23e97c._comment b/doc/forum/Ensure_all_versions_are_on_remotes/comment_2_ad5f1f0b98032361e64bb7275d23e97c._comment
new file mode 100644 (file)
index 0000000..ccf430f
--- /dev/null
@@ -0,0 +1,20 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2022-09-13T18:40:02Z"
+ content="""
+`sync --content` will certianly remove files from a repository when
+the preferred content settings for that repository indicate it should
+not contain that content.
+
+When you use `sync --all`, a preferred content setting like
+`"include=*"` or `"exclude=*"` will only ever match files in the current
+working tree, not past versions of files. 
+
+So, if the remote has such a preferred content expression, `sync --all
+--content` will remove the past versions of files from it.
+
+The way to avoid this behavior is to use a preferred content expression
+that does not match on the filename. Eg, `"anything"`. Or don't set a
+preferred content expression in the first place.
+"""]]